 <{extends file="<{$tempdir}>/public/site.html"}>  
  <{block name=extendjs}>
  <script type="text/javascript" language="javascript" src="<{$siteurl}>/templates/<{$tempdir}>/public/js/gift.js"> </script>
  <script src="<{$siteurl}>/templates/<{$tempdir}>/public/js/bootstrap.min.js" type="text/javascript" language="javascript"></script>
  <{/block}>
  <{block name=sitetitle}>礼品街<{/block}>
 <{block name=extendcss}>
         <link rel="stylesheet" href="<{$siteurl}>/templates/<{$tempdir}>/public/css/2.1/base.css" />
        <link rel="stylesheet" href="<{$siteurl}>/templates/<{$tempdir}>/public/css/2.1/model.css" />
        <link rel="stylesheet" href="<{$siteurl}>/templates/<{$tempdir}>/public/css/2.1/gift.css" />
           <link rel="stylesheet" type="text/css" href="<{$siteurl}>/templates/<{$tempdir}>/public/css/gift.css"> 
 <link rel="stylesheet" type="text/css" href="<{$siteurl}>/templates/<{$tempdir}>/public/css/ordering.css">  
 <link rel="stylesheet" type="text/css" href="<{$siteurl}>/templates/<{$tempdir}>/public/css/ordercf.css"> 
<link rel="stylesheet" type="text/css" href="<{$siteurl}>/templates/<{$tempdir}>/public/css/gift.css">   
 <{/block}>
  <{block name=shophide}><{/block}>
<{block name=bodylist}> 
<div class="js_MASK" style="opacity: 0.6; position: fixed;
top: 0;
left: 0;
z-index: 1000;
background: #000; width: 100%; height: 100%; display: none ;"></div>


	<div id="FirstIndex"></div>
       
        
        <!--main-->
        <div id='gift'>
            <div class="webMainModel clearfix">
                <!--左侧礼品列表-->
                <div id='gift-list'>
                    <ul class='clearfix'>
                    	
                    	
                    	 <{load_data assign="list" table="gift"   fileds="*"  limit="100" }> 
            	    <{foreach from=$list['list'] item=value}>
                   <li>
	                            <div class='gift-ImgWarp'>
	                                <img style="width:260px; height:260px;" src="<{$imgserver}><{$value['img']}>" width='260' height='260' />
	                            </div>
	                            <h3 class="gift-itemTitle"><{$value['title']}></h3>
	                            <p>现金购买：<b>￥<{$value['market_cost']}></b></p>
	                            <p>库存：<{$value['stock']}>个</p>
                                
	                            <p class="gift-exchange"><i class='gift-price'><{$value['score']}></i>积分
                                <span class='gift-changeBtn'  onclick="selPrizeItem('<{$value['id']}>','<{$value['title']}>','<{$value['score']}>','<{$value['stock']}>','<{$value['market_cost']}>')" class="btn_duihuan">我要兑换</span></p>
	                        </li>
                  <{/foreach}> 
                    	 
                    </ul>
                </div>
            
                <!--右侧信息-->
                <div class='gift-msn'>
                    <!--积分信息-->
                    <div class="gift-usableInt" style="background:#f38383;">
                        <!--bg-->
                        <div class="back-bg"></div>
                        <h3>我的可用积分</h3>
                        <p class="gift-intNum" id="jifen"><{$member['score']|default:0}></p>
                        <p class='gift-msnRule'>
                        	<a href="<{ofunc type=url link="/site/single/show/jfgz"}> "target="_blank">积分规则</a><a href="<{ofunc type=url link="/member/jifenlog"}>" target="_blank">积分明细</a>
                        	<i class="triangle"></i>    
                        </p>
                    </div>
                    
                    
                    
                    <!--礼品车-->
                    <div class="car shaDow">
                        <h2 class="moudleH2">礼品兑换</h2>
                        <ul class="car-list" id="c_lipin">
                            <!--  <li>
                                <span class="car-goodsTitle">记事贴</span>
                                <!--操作--
                                <div class="car-handle">
                                    <i class="less">-</i>
                                    <input type="text" class='' />
                                    <i class="add">+</i>
                                </div>
                                <b class='car-goodsInt'>1000积分</b>
                                
                                <!--delete button--
                                <i></i>
                            </li>-->
                            
                            
						
						
						<div class="ordered">
							<table id="table_canpin" style="display:none">
								<tbody><tr class="border_bottom">
									<td class="acc">礼品价值</td>
									<td class="mid"></td>
									<td class="orange14b align-right" id="totalScore">0</td>
								</tr>
								</tbody>
                                <tbody id="t_lipin">
								 
								</tbody>

							</table>

							<table id="t_heji" style="display:none">
								<tbody>
								<tr class="ordertip">
									<td colspan="3" class="heji"><p></p></td>
								</tr>
							</tbody></table>
						</div>
				
                            
                        </ul>
                    
                        <!--总积分-->
                        <p class="car-sum">合计<strong id='car-sum'><em class="orange14b" id="total" data="0">￥0.0</em></strong>积分</p>
                    </div>
                    
                    <!--配送详情-->
                    <div class="Shipping-info shaDow">
                        <h2 class="moudleH2">用户信息</h2>
                        <form class="ship-form">
                            <ul class="clearfix">
                                <!--<li class="shipping-name"><label>姓名：</label><input type='text'class='txt name' value=""  id="uname"/></li>
                                
									<li class="shipping-sex" value='1'><i class="radio active" id="dwb_sex_female" value="1">女士</i><i class="radio" id="dwb_sex_male" value="0">先生</i></li>
								
                                <li><label>手机：</label><input type='text' class='txt' id="uphone"  value=""/></li>
                                <li><label>地址：</label><input type='text' class='txt' id="uaddress" value=""/></li>
                                <li><label>备注：</label><input type='text' class='txt' id="unRemark"/></li>
                                <li class="shipping-give"><b class="checkBox checked" id="sendToOther">送给他人</b></li>-->
                                
                                <p class="ordered_title">
							<span class="yleft">姓名</span>
							<span class="ordered_date">
								<input id="uname" maxlength="10" class="msn" value="" >
								<!--
									<input id="dwb_sex_female" name="dwb_sex" type="radio" value="1"   checked="checked">女士
									<input id="dwb_sex_male" name="dwb_sex" type="radio" value="0" disabled="disabled">先生  -->
							</span>
						</p>

						<p class="ordered_title">
							<span class="yleft">手机</span>
							<span class="ordered_date">
								<input id="uphone" maxlength="30"   value="">
							</span>
						</p>

						<p class="ordered_title" id="areatop">
							<span class="yleft">地址</span>
							<span class="ordered_date">
								<input id="uaddress" maxlength="50"   value="">
							</span>
						</p>

						<p class="ordered_title">
							<span class="yleft">备注</span>
							<span class="ordered_date">
							<input id="unRemark" maxlength="50"   value="" style="border: 1px solid #ccc;height: 24px;width:175px;">
							</span>
							
						</p>

					 

						<p class="ordered_title_auto" id="sendremarks" style="display:none">
							<span class="yleft">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
							<span class="ordered_date">
								<textarea id="Usendremark">请输入希望我们帮您转达的消息...</textarea>
							</span>
						</p>
                                
                            </ul>
                            <textarea class="shipping-textarea"  id="Usendremark"  style="display:none">请输入希望我们帮您转达的消息..</textarea>
                        </form>
                    </div>
                    
                    <p class="ship-sub next_btn listSprit" style="background:#f38383;"  id='next'>下一步<span class="ship-subRight"></span></p>
                </div>
            </div>
        </div>
        
        <!--底部-->
        
	<!--底部-->
 <div id="success-list" style="display: none;">
	<div class="title">订单信息核对</div>
	<div class="list" id="orderList">
		<table class="top"><tbody><tr class="tr1"><th colspan="5">积分商品兑换</th><!-- <th colspan="2" class="ps">发送方式：邮箱短信</th> --></tr>
		<tr class="tr2"><td class="cp">餐品</td><td class="jg">价格</td><td class="sl">数量</td><td class="xj">小计</td><td class="bz">备注</td>
        
        </tr></tbody>
			</table>
			<div class="canpin_list">
				<table class="middle">
					<tbody id="updivmidle">
						 
		      </tbody>
		    </table>
		  </div>
		  <table class="bottom">
		  	<tbody>
		  		 
		  	  
		  	  
		  	</tbody>
		  </table>
		 </div>
    <div id="notice">
  <!--   <p><span>充值卡卡号与密码以短信或邮件形式在3个工作日内发送到您注册时填写的邮箱和手机，如需修改邮箱和手机，请到会员中心账户基本资料下修改</span></p> -->
    <!--
    
		<p>①<span>第一次使用</span>我们的服务时，我们将会与您<span>电话确认</span>；若号码无法联系，我们将会把您的订单设为无效。</p>
		<p>②商家商品价格可能会突发调整，若网站上价格与商家实际价格不同，将<span>以商家最新价格为准</span>。</p>
		<p>③您<span>可实时监控</span>自己的订单进度，当进度状态为预订中时可退订或修改，其他状态时均不可变更。</p>
		<p>④高峰期时，订单按下单先后依次排队安排，送达时间会有所延长，敬请谅解。为更准时送达，建议预订。</p>-->
	  </div>
	  <div id="btn">
	  	   <img onmouseover="this.style.cursor='pointer';" onclick="backandmodify()" src="/upload/shop/btn_back.jpg"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	  	   <img onmouseover="this.style.cursor='pointer';" onclick="king_tijiaodingdan()" src="/upload/shop/btn_submit.jpg"> 
	  </div>
	  <div id="showsubmit" style="margin: 10px auto 0px;width:700px;display:none;">数据提交中.....</div>
</div>
<div id="fade" class="black_overlay" style="display:none;"></div>   
    
<script id="trgoodlist" type="text/html"> 
	<tr id="tr_<^%=gid%^>" class="orderPart1" gid="<^%=gid%^>" gcost="<^%=gscore%^>" bagcost="0" stock="<^%=gstock%^>">
						     	 <td class="acc"><b class="menuname" title="<^%=gtitle%^>"><^%=gtitle%^></b></td>
						     	 <td class="amount">
						     	 	    <span class="minus_Minus listSprit" id="<^%=gid%^>_Amount_reduce" style="border:1px solid #ccc; width:17px; height:17px; line-height:17px;text-align:center;" onclick="delOrReduceAmount(<^%=gid%^>,1)">-</span>
						     	 	    <input type="text" id="<^%=gid%^>_Amount" value="1" class="minus_add_num" onblur="chnageAmount(<^%=gid%^>)"><span class="minus_add listSprit" id="<^%=gid%^>_Amount_add" style="border:1px solid #ccc;line-height:17px; text-align:center; width:17px; height:17px;"  onclick="addOrReduceAmount(<^%=gid%^>,1)">+</span>
						     	 	</td>
	 <td id="<^%=gid%^>_stPrice" style=" float:right;" class=""><^%=gscore%^></td>
 </tr> 
</script>    
<script> 
	 var getcxinfo = '<{ofunc type=url link="/fastfood/getcx/random/@random@"}>';
	 var arealist = <{$myarealist|@json_encode}>;
	 var areagrade = <{$area_grade}>; 
	 var submithtml = '<{ofunc type=url link="/gift/newexchang/datatype/json/random/@random@"}>';
	 <{if empty($member['uid'])}>
	 var memberscore = 0;
	 <{else}>
	 	var memberscore = <{$member['score']}>;
	 	<{/if}>
	  var mydefaultadress = <{$mydefaultadress|@json_encode}>;
</script>
<script id="areaid1" type="text/html">  
<p class="ordered_title" id="liarea1">
                    <span class="yleft">区域:</span>
                    <span class="ordered_date" style="margin-left: 10px;" id="belongcity1">
                       <select name="area1" id="area1" onchange="dotype2();">
				<^%for(i = 0; i < list.length; i ++) {%^>
					<^%if(list[i].parent_id == showid){%^>
             <option value="<^%=list[i].id%^>" <^%if(list[i].id == selectid){%^> selected <^%}%^>>
             <^%=list[i].name%^>
             </option>
             <^%}%^>
        <^%}%^> 
				
				</select>
				
                    </span>
 </p>
</script>
<script id="areaid2" type="text/html">  
<p class="ordered_title" id="liarea2">
                    <span class="yleft">区域:</span>
                    <span class="ordered_date" style="margin-left: 10px;"  id="belongcity2">
                       <select name="area2" id="area2" onchange="dotype3();">
				<^%for(i = 0; i < list.length; i ++) {%^>
					<^%if(list[i].parent_id == showid){%^>
             <option value="<^%=list[i].id%^>" <^%if(list[i].id == selectid){%^> selected <^%}%^>>
             <^%=list[i].name%^>
             </option>
             <^%}%^>
        <^%}%^>  
				</select>
                    </span>
 </p>
</script>
<script id="areaid3" type="text/html">  
<p class="ordered_title" id="liarea3">
                    <span class="yleft">区域:</span>
                    <span class="ordered_date"style="margin-left: 10px;"  id="belongcity3">
                       <select name="area3" id="area3" onchange="dotype4();">
				<^%for(i = 0; i < list.length; i ++) {%^>
					<^%if(list[i].parent_id == showid){%^>
             <option value="<^%=list[i].id%^>" <^%if(list[i].id == selectid){%^> selected <^%}%^>>
             <^%=list[i].name%^>
             </option>
             <^%}%^>
        <^%}%^> 
				
				</select>
                    </span>
 </p>
</script>
<script>
$(function(){  
	     $('#uname').val(mydefaultadress.contactname);
	     $('#uphone').val(mydefaultadress.phone); 
	     $('#uaddress').val(mydefaultadress.address);
	     if(mydefaultadress.sex == 0){
	     	 
	     	$('#dwb_sex_male').attr('checked',true);//('click');
       }     
	  if(arealist.length > 0){ 
 	   	var htmls = template.render('areaid1', {list:arealist,showid:0,selectid:mydefaultadress.areaid1});
          $('#areatop').before(htmls);
          if(areagrade > 1){
           dotype2();
         } 
    }
});
function dotype2(){
	if(areagrade > 1){
	var findvalue = $('#area1').find("option:selected").val();
 	$('#liarea2').remove();
 		var htmls = template.render('areaid2', {list:arealist,showid:findvalue,selectid:mydefaultadress.areaid2});
          $('#areatop').before(htmls);
          if(areagrade > 2){
 		 dotype3();
 		} 
 	} 
}
function dotype3(){
	if(areagrade > 2){
	var findvalue = $('#area2').find("option:selected").val();
 	$('#liarea3').remove();
 		var htmls = template.render('areaid3', {list:arealist,showid:findvalue,selectid:mydefaultadress.areaid3});
          $('#areatop').before(htmls); 
  } 
}
 
	</script> 
<div style="height:20px;clear:both;"></div>
<{/block}>